import 'package:flutter_test/flutter_test.dart';
import 'package:stripe_terminal_usb/stripe_terminal_usb.dart';
import 'package:stripe_terminal_usb/stripe_terminal_usb_platform_interface.dart';
import 'package:stripe_terminal_usb/stripe_terminal_usb_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockStripeTerminalUsbPlatform
    with MockPlatformInterfaceMixin
    implements StripeTerminalUsbPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');




  @override
  Future<bool> cancelRetrievePaymentIntent() {
    // TODO: implement cancelRetrievePaymentIntent
    throw UnimplementedError();
  }

  @override
  Future<void> connectReaders() {
    // TODO: implement connectReaders
    throw UnimplementedError();
  }

  @override
  Future<Map> pay(String clientSecret) {
    // TODO: implement pay
    throw UnimplementedError();
  }

  @override
  Future<bool> permissionAllowed() {
    // TODO: implement permissionAllowed
    throw UnimplementedError();
  }

  @override
  Future<Map> processPayment() {
    // TODO: implement processPayment
    throw UnimplementedError();
  }

  @override
  Future<Map> cancelProcessPayment() {
    // TODO: implement cancelProcessPayment
    throw UnimplementedError();
  }

  @override
  Future<Map> openCash() {
    // TODO: implement openCash
    throw UnimplementedError();
  }

  @override
  Future<bool> initOpenCash() {
    // TODO: implement initOpenCash
    throw UnimplementedError();
  }

  @override
  Future<void> init(String localId, String tokenUrl, String departId) {
    // TODO: implement init
    throw UnimplementedError();
  }

}

void main() {
  final StripeTerminalUsbPlatform initialPlatform = StripeTerminalUsbPlatform.instance;

  test('$MethodChannelStripeTerminalUsb is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelStripeTerminalUsb>());
  });

  test('getPlatformVersion', () async {
    StripeTerminalUsb stripeTerminalUsbPlugin = StripeTerminalUsb();
    MockStripeTerminalUsbPlatform fakePlatform = MockStripeTerminalUsbPlatform();
    StripeTerminalUsbPlatform.instance = fakePlatform;

    expect(await stripeTerminalUsbPlugin.getPlatformVersion(), '42');
  });
}
